<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>生成补缴明细</title>
  <META HTTP-EQUIV="pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> 
<META HTTP-EQUIV="expires" CONTENT="0">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<script src="../../../layui/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/angular.js" charset="utf-8"></script>
<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../gjjhbj/fy.js"></script>
<script src="../../../layui/layui/layui.js" charset="utf-8"></script>

	<link rel="stylesheet" href="../../../css/font_eolqem241z66flxr.css" media="all" />
	<link rel="stylesheet" href="../../../css/news.css" media="all" />
	<script type="text/javascript" src="../../../layui/layui/GetPath.js"></script>
<body  class="childrenBody">

	<!-- 邮件发送 -->
	<div class="sysNotice col">
			<blockquote class="layui-elem-quote title">生成补缴明细</blockquote>
			<table class="layui-table">
				<colgroup>
					<col width="10%"  style="min-width:100px">
					<col width="20%">
					<col width="10%" style="min-width:100px">
					<col  width="50%">
				</colgroup>
				</table></div>
<div  ng-app="myApp" ng-controller="customersCtrl" align="center" >
	<loading></loading>
		<div align="left">    <button class="layui-btn " ng-click="scmx()">生成明细</button></div>
		<div >
		<table class="layui-table" style="width:100%">
			<tr align="center" style="background-color:#f1f1f1">
			<td ng-show=false>当前行数</td >
				<td>应缴年月</td>
				<td>补缴额</td>
				<td>补缴人数</td>
				<!-- <td>操作</td> -->
				<td><input type="checkbox" ng-model="all" ng-click="checkAll()"></td>  
				
			</tr>
			<tr ng-repeat="x in data" align="center">
				<td ng-if="$odd" ng-show=false style="background-color:#f1f1f1">{{ $index+1 }}</td>
				<td ng-if="$even"  ng-show=false >{{ $index+1 }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.NY }}</td>
				<td ng-if="$even"  >{{ x.NY }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.BJE }}</td>
				<td ng-if="$even">{{ x.BJE }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.JCRS }}</td>
				<td ng-if="$even">{{ x.JCRS }}</td>
				<!-- <td ng-if="$odd" style="background-color:#f1f1f1"><input type="button" style="color: red" ng-click="hi();ny($index)" value="&nbsp;查&nbsp;&nbsp;询&nbsp;">
				</td>
				<td ng-if="$even"><input type="button" style="color: red" ng-click="hi();ny($index)"   value="&nbsp;查&nbsp;&nbsp;询&nbsp;">
				</td> -->
				<td ng-if="$odd" style="background-color:#f1f1f1"><input type="checkbox" name="chk" ng-model="item.chk" ng-checked="all" ng-click="A1($index)"/>
				</td>
				<td ng-if="$even"><input type="checkbox" name="chk" ng-model="item.chk" ng-checked="all" ng-click="A1($index)"/>
				</td>
				
			</tr>
		</table>
		</div>
	<!-- 	<div style="float: right;width: 45%;text-align: center;" ng-hide="myVar" >
				<table class="layui-table" style="width:90%" ng-show="visible">
			<tr align="center" style="background-color:#f1f1f1">
				<td>姓名</td>
				<td>个人账号</td>
				<td>个人月缴存额</td>	
			</tr>
			<tr ng-repeat="x in names" align="center">
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.XINGMING }}</td>
				<td ng-if="$even">{{ x.XINGMING }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.GRZH }}</td>
				<td ng-if="$even">{{ x.GRZH }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.GRJCE }}</td>
				<td ng-if="$even">{{ x.GRJCE }}</td>
				
			</tr>
		</table>
		<div style="text-align: center;" ng-show="visible">
		<div class="layui-btn-group">
			
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Previous()">上一页</button>
			<button ng-repeat="page in pageList" class="layui-btn layui-btn-primary layui-btn-sm "
				ng-click="selectPage(page)" >{{page}}</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Next()">下一页</button>
				<br>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Sy()">首页</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm "
				>{{selPage}}/{{pages}}</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Wy()">尾页</button>
			
		</div>
  </div>
		</div> -->
	</div>	
	<script>
		layui.use('element', function() {
			var $ = layui.jquery, element = layui.element;
		});
	</script>
	<script type="text/javascript">
	function getPath() {  
	    return 'http://'+location.host;
	}
	</script>
<script type="text/javascript" src="../../../layui/lay/modules/layer.js"></script>
<script type="text/javascript" src="../../../layui/layer.ext.js"></script>
	<script type="text/javascript">
		var a;
		var app = angular.module('myApp', []);
			 app.directive('loading', function(){  
		        return {  
		            restrict: 'E',  
		            transclude: true,  
		            template: '<div ng-show="loading" class="loading" id="allDiv"  style="position:fixed; top:0px; left:0px; width:100%; height:100%; display:none; background-color:#000; opacity: 0.5; z-index:99999;">'  
		            +'<img alt="" src="../../../layui/layui/img/jz.gif" style="vertical-align: middle;width:30px; height:30px; position: absolute; top:50%; left:50%; margin-top: -50px; margin-left:-50px;"/>'
		            +'</div>',  
		            link: function (scope, element, attr) {  
		                scope.$watch('loading', function (val) {  
		                    if (val){  
		                        document.getElementById("allDiv").style.display = "block";  
		                    }else{  
		                        document.getElementById("allDiv").style.display = 'none';  
		  
		                    }  
		                });  
		            }  
		        };
		    }); 
		app.controller('customersCtrl', function($scope, $http) {
		
		  $scope.setLoading =function(){  
			    if($scope.loading ==undefined || $scope.loading ==false){  
			        $scope.loading=true;  
			    }else{  
			        $scope.loading=false;  
			    };
			};
	
			$scope.A1=function(index){
			if($scope.data[index].chk==undefined||$scope.data[index].chk==false)
				$scope.data[index].chk=true;
			else
				$scope.data[index].chk=false;
			};
			$index=1;
			var isAllSeclected = true;  
			$scope.checkAll = function() {  
			    for(var i = 0; i < $scope.data.length; i++) {  
			        if(isAllSeclected){  
			            $scope.data[i].chk = true;  
			        }else{  
			            $scope.data[i].chk = false;  
			        }  
			    }  
			    isAllSeclected=!isAllSeclected;  
			}
			$scope.scmx=function(){
			
			var abc="";
			var pa=new Array() ;
			var li=new Array() ;
			var YJJE=new Array() ;
			  for(var i = 0; i < $scope.data.length; i++) {
			        if($scope.data[i].chk ){
			        li.push(i);
			        pa.push($scope.data[i].NY);
			        YJJE.push($scope.data[i].BJE);
			         } ;
			         }
			         	 if(pa==null||pa.length==0)
			 {
			 layer.alert('提示：请先选择要生成明细的信息', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});	
			 }
			 else{
			 	$scope.setLoading();
			         $http({
				url:getPath() + "/wsyyt/bjgncontroller/test6",
				contentType:"text/html;charset=utf-8",
				method:'post',
				params:{NY:pa,YJJE:YJJE}
				
         			
			})
			
					.then(
							function(res) {
							
							var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
							if(res.data.msg!='成功')
							
							layer.confirm('提示：'+res.data.msg, {
							skin: 'layui-layer-molv',anim: 1,
							btn: ['确认'],
							icon: 5    ,
							  btn: ['确认'] //可以无限个按钮
							  ,btn1: function(index, layero){
							    window.location.reload();
							  }
							});
														
								     if(res.data.msg=='成功')	{
								     parent.location.reload();  
							parent.layer.close(index); //再执行关闭  
							}
							
								$scope.setLoading();
							});
							}
							};
			
		 $scope.setLoading();
			$http({
				url:getPath() + "/wsyyt/bjgncontroller/test5",
				contentType:"text/html;charset=utf-8",
				method:'post',
				params:$scope.params,
				
         			
			})
					.then(
							function(res) {
							 $scope.setLoading();
								$scope.data = res.data.data;//自己打断点看格式:[{},{}]
									$scope.names="";
									$scope.selPage="";
									$scope.selectPage="";
									$scope.pages="";
									$scope.page="";
									$scope.pageList="";
									if(res.data.msg!='成功')
									layer.alert('提示：'+res.data.msg, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});			
									return null;	
									})	;				
   	  $scope.hi = function() {
        $scope.visible = true;
   	 }
   	 //把年月传到后台
   /* 	 $scope.ny = function (index) {
   	  $scope.setLoading();
			$http({
				url:getPath() + "/wsyyt/jctsqrcontroller/test1",
				contentType:"text/html;charset=utf-8",
				method:'post',
				params:{YJNY:$scope.data[index].YJNY},
				
			})
					.then(
							function(res) {
							 $scope.setLoading();
								$scope.data1 = res.data.data;//自己打断点看格式:[{},{}]
									$scope.names="";
									$scope.selPage="";
									$scope.selectPage="";
									$scope.pages="";
									$scope.page="";
									$scope.pageList="";
									layer.msg('提示：'+res.data.msg);		
								feny($scope.data1);
		});
      }; */
      //查询页
});
	</script>	
</body>
</html>
